/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import { DVModelContainer } from '../uimanager/DynamicView';
import { JSIModuleType } from './JSIModuleType';
import { JavaScriptContextHolder } from './JavaScriptContextHolder';
import { NativeArray } from './NativeArray';
import { RuntimeScheduler } from './RuntimeScheduler';
import { JSIModuleSpec } from './JSIModuleSpec';
import { RuntimeExecutor } from './RuntimeExecutor';
import ArrayList from '@ohos.util.ArrayList';
import { NativeModuleRegistry } from './NativeModuleRegistry';
import HashSet from '@ohos.util.HashSet';
import { JSIModule } from './JSIModule';
import { JavaScriptModule } from './JavaScriptModule';
import { ReactQueueConfiguration } from './queue/ReactQueueConfiguration';
import { NativeModule } from './NativeModule';
import { JSBundleLoaderDelegate } from './JSBundleLoaderDelegate';
import { JSInstance } from './JSInstance';
import { NativeArrayInterface } from './NativeArrayInterface'


export interface CatalystInstance extends JSInstance, JSBundleLoaderDelegate {
    runJSBundle(callBack: (string) => void): void;
    runApplication(callBack: (string) => void):void;
    processPackages(callBack: (type: string) => void): void

    //todo
    onHostForeground();

    // onHostBackground()

    hasRunJSBundle(): boolean;

    getSourceURL():string;

    invokeCallback(var1:number , var2: NativeArrayInterface): void

//    @DoNotStrip
     callFunction(var1: string, var2: string,  var3: NativeArray): void;

    callJSFunction(): void;

    destroy():void;

     isDestroyed(): boolean;

//    @VisibleForTesting
    initialize(): void;

     getReactQueueConfiguration(): ReactQueueConfiguration;

//     T getJSModule<T extends JavaScriptModule>(Class<T> var1);
//     getJSModule<T extends JavaScriptModule>(var1: string): T;
//
//
////      hasNativeModule<T extends NativeModule>(Class<T> var1): boolean;
//      hasNativeModule<T extends NativeModule>(var1: string): boolean;
////    @Nullable
////     T getNativeModule<T extends NativeModule>(Class<T> var1);
//    getNativeModule<T extends NativeModule>(var1: string): T
//
////    @Nullable
//     getNativeModule(var1: string): NativeModule
//
//     getJSIModule(var1: JSIModuleType): JSIModule
//
     getNativeModules(): HashSet<NativeModule>
//
//    extendNativeModules( var1: NativeModuleRegistry): void;

//    addBridgeIdleDebugListener( var1: NotThreadSafeBridgeIdleDebugListener): void;
//
//    removeBridgeIdleDebugListener( var1: NotThreadSafeBridgeIdleDebugListener): void;

//     registerSegment(var1: number,  var2: String): void;
//
////    @VisibleForTesting
//      setGlobalVariable(var1: string, var2: string): void

      /** @deprecated */

      attachReactRoot(modelContainer: DVModelContainer): void;
      setUpMessageResponse(): void;
      getJavaScriptContextHolder(): JavaScriptContextHolder;

      getRuntimeExecutor(): RuntimeExecutor;

      getRuntimeScheduler(): RuntimeScheduler;

//      addJSIModules(var1: ArrayList<JSIModuleSpec<JSIModule>>): void;

//      getJSCallInvokerHolder(): CallInvokerHolder;

//      getNativeCallInvokerHolder(): CallInvokerHolder;

//      setTurboModuleManager(var1: JSIModule): void;
}
